package com.xinqi.modules.mq.delay.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.mq.delay.dto.MqDelayMessageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 延时消息客端
 *
 * @author linkai
 * @date 2023/11/20
 */
@FeignClient(contextId = "delayMessageClient", value = ServiceNameConstants.XQ_MQ)
public interface DelayMessageClient {
    String INNER_PREFIX = "/inner/delay-message";

    /**
     * 删除延时消息
     */
    @DeleteMapping(INNER_PREFIX + "/{mq-id}")
    R<Boolean> delete(@PathVariable("mq-id") String mqId);

    /**
     * 添加延时消息
     */
    @PostMapping(INNER_PREFIX)
    R<Boolean> create(@RequestBody MqDelayMessageDTO dto);

}
